package com.yc.sole.financial.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yc.sole.common.enums.PaymentMethod;
import jakarta.persistence.*;
import lombok.Data;

import java.math.BigDecimal;

/**
 * 收款表
 *
 * @author yizuomin
 * @date 2024/3/8 10:15
 **/
@Data
@Entity
@Table(name = "financial_receipt")
@TableName("financial_receipt")
public class Receipt {

    /**
     * id
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @TableId(type = IdType.AUTO)
    private Long id;
    /**
     * 收款编号
     */
    @Column(columnDefinition = "VARCHAR(20) NOT NULL COMMENT '收款编号'", unique = true)
    private String receiptNo;
    /**
     * 客户id
     */
    @Column(columnDefinition = "BIGINT NOT NULL COMMENT '客户id'")
    private Long customerId;
    /**
     * 客户名称
     */
    @Column(columnDefinition = "VARCHAR(50) NOT NULL COMMENT '客户名称'")
    private String customerName;
    /**
     * 关联订单id
     */
    @Column(columnDefinition = "BIGINT NOT NULL COMMENT '关联订单id'")
    private Long orderId;
    /**
     * 订单编号
     */
    @Column(columnDefinition = "VARCHAR(32) NOT NULL COMMENT '订单编号'")
    private String orderNo;
    /**
     * 收款金额
     */
    @Column(columnDefinition = "DECIMAL(18,2) NOT NULL COMMENT '回款金额'")
    private BigDecimal amount;
    /**
     * 收款日期
     */
    @Column(columnDefinition = "VARCHAR(20) NOT NULL COMMENT '收款日期'")
    private String receiptDate;
    /**
     * 收款方式 0现金支付 1微信支付 2支付宝支付 3银行卡转账
     */
    @Column(columnDefinition = "TINYINT NOT NULL COMMENT '收款方式 0现金支付 1微信支付 2支付宝支付 3银行卡转账'")
    private PaymentMethod receiptMethod;
    /**
     * 备注
     */
    @Column(columnDefinition = "VARCHAR(255) COMMENT '备注'")
    private String remark;
}
